﻿using System;
using System.Collections.Generic;
using System.Data;
using Runda.EShop.Common.Utility;
using Runda.EShop.Dal;
using Runda.EShop.Common.Entity;


namespace Runda.EShop.Bll
{
    public partial class RelationCustomerProductBll 
    {
        public DataTable GetProductListByCustomer(Guid CustomerID, string OrderBy, int PageSize, int PageIndex, out int RecordCount)
        {
            RelationCustomerProductDal dal = new RelationCustomerProductDal();

            return dal.GetProductListByCustomer(CustomerID, OrderBy, PageSize, PageIndex, out RecordCount);
        }
        public DataTable GetProductListByCustomer(Guid CustomerID,string WhereSql, string OrderBy, int PageSize, int PageIndex, out int RecordCount)
        {
            RelationCustomerProductDal dal = new RelationCustomerProductDal();

            return dal.GetProductListByCustomer(CustomerID,WhereSql, OrderBy, PageSize, PageIndex, out RecordCount);
        }

        public void BatchCustomerProduct(List<RelationCustomerProductEntity> list)
        {
            RelationCustomerProductDal dal = new RelationCustomerProductDal();

            foreach (RelationCustomerProductEntity entity in list)
            {
                dal.InsertOrUpdate2(entity);
            }
        }

        public void Delete(Guid CustomerID, Guid ProductID)
        {
            RelationCustomerProductDal dal = new RelationCustomerProductDal();
            dal.Delete(CustomerID, ProductID);
        }
    }
}

